<html>
    <head>
    <script src="{{=URL('static', 'jquery-ui/jquery-1.4.4.min.js')}}" type="text/javascript"></script>
    <script src="{{=URL('static', 'jquery-ui/jquery-ui-1.8.9.custom.min.js')}}" type="text/javascript"></script>
    <script type="text/javascript" src="{{=URL('static', 'jquery.facebook.multifriend.select.js')}}"></script>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/mootools/1.3.0/mootools-yui-compressed.js"></script>
    <script type="text/javascript" src="{{=URL('static', 'lightface/LightFace.js')}}"></script>
    <script type="text/javascript" src="{{=URL('static', 'lightface/LightFace.Request.js')}}"></script>
    <link rel="stylesheet" href="{{=URL('static', 'lightface/LightFace.css')}}" />
    <link rel="stylesheet" href="{{=URL('static', 'jquery.facebook.multifriend.select.css')}}" />

    <script>
        $(function() {
        $( "#tabs" ).tabs({
        ajaxOptions: {
            error: function( xhr, status, index, anchor ) {
                $( anchor.hash ).html(
                    "還是空的呢，趕快叫你朋友一起加入吧！");
                     }
                }
        });
    });
        </script>
        <link href="{{=URL('static', 'jquery-ui/jquery-ui-1.8.9.custom.css')}}" rel="stylesheet" type="text/css">
        <link href="{{=URL('static', 'css/fb_main.css')}}" rel="stylesheet" type="text/css">
    </head>
    <body>
        <div id="like_button" style="text-align:center;">
            <fb:like href="http://apps.facebook.com/lucky_money/" show_faces="false" width="200" style="clear:both;"></fb:like>
        </div>
        <div id="main_content">
	    {{include}}	
        </div>
        <div id="ads">
        <!-- Begin Ad Call Tag - Do not Modify -->
        <iframe width='728' height='90' frameborder='no' framespacing='0' scrolling='no'  src='http://ads.lfstmedia.com/fbslot/slot14036?ad_size=728x90&adkey=02b'></iframe>
        <!-- End of Ad Call Tag -->
        </div>
        <div id="footer" style="font-size:12px; text-align:center; clear:both; padding: 12px;">
            <a href="http://blog.systemsthoughts.com/" target="_blank">軟體作者部落格</a>
        </div>
        <!-- Facebook JS SDK -->
        <div id="fb-root"></div>
        <script>
              window.fbAsyncInit = function() {
                  FB.init({appId: '140926039267506', status: true, cookie: true,
                      logging : true, xfbml: true});
                  FB.Canvas.setSize();
                  FB.getLoginStatus(function(response) {
                      if (response.session) {
                          // logged in and connected user, someone you know
                          // FB.XFBML.parse($("#invite_box")[0]);
                          //FB.ui({method: 'apprequests', message: 'You should learn more about this awesome game.', data: 'tracking information for the user'});
                          } else {
                          // no user session available, someone you dont know
                          //alert("I don't know you. Gonna let you in first.");
                          top.location.href="https://graph.facebook.com/oauth/authorize?scope=publish_stream&redirect_uri=http://apps.facebook.com/lucky_money/&client_id=140926039267506";
                      }
                  });
                };
            (function() {
                var e = document.createElement('script'); 
                e.async = true;
                e.src = document.location.protocol +
                        '//connect.facebook.net/en_US/all.js';
                            document.getElementById('fb-root').appendChild(e);
                    }());
        </script>
    </body>
</html>
